﻿
@model TheNorthStar.Web.Models.ViewModels.AdminHomeViewModel
@{
    ViewBag.Title = "Index";
}

<h2>Current Bookings</h2>

<table id="results" class="table table-striped">
    <thead><tr>
               <td>Booking Reference</td>
               <td>Customer Phone Number</td>
               <td>Pickup Suburb</td>
               <td>Status</td>
               <td>Driver Name</td>
               <td>Creation Date</td>
           </tr>
    </thead>
    <tbody>
    @foreach(var booking in Model.Bookings)
    {
        <tr>
            <td>@booking.BookingId</td>
            <td>@booking.Customer.PhoneNumber</td>
            <td>@booking.PickupSuburb</td>
            <td>@booking.Status</td>
            <td>@(booking.Driver != null ? string.Format("{0} {1}",booking.Driver.FirstName,booking.Driver.LastName) : "None!")</td>
            <td>@{
                    var x = TimeZoneInfo.GetSystemTimeZones();
                    
                    TimeZoneInfo tzi = TimeZoneInfo.FindSystemTimeZoneById("AUS Eastern Standard Time");
                    var time = booking.CreateDateTime.Value.Add(tzi.BaseUtcOffset);//TimeZoneInfo.ConvertTimeBySystemTimeZoneId(booking.CreateDateTime.Value, "AUS Eastern Standard Time");

                    var y = time.IsDaylightSavingTime();
<text> @time </text>
                }
            </td>
        </tr>
    }
    </tbody>
</table>


